package app.aaps.core.data.ue

enum class Action(val colorGroup: ColorGroup) {
    BOLUS(ColorGroup.InsulinTreatment),
    BOLUS_CALCULATOR_RESULT(ColorGroup.InsulinTreatment),
    BOLUS_CALCULATOR_RESULT_REMOVED(ColorGroup.Aaps),
    SMB(ColorGroup.InsulinTreatment),
    BOLUS_ADVISOR(ColorGroup.InsulinTreatment),
    EXTENDED_BOLUS(ColorGroup.InsulinTreatment),
    SUPERBOLUS_TBR(ColorGroup.InsulinTreatment),
    CARBS(ColorGroup.CarbTreatment),
    EXTENDED_CARBS(ColorGroup.CarbTreatment),
    TEMP_BASAL(ColorGroup.BasalTreatment),
    TT(ColorGroup.TT),
    NEW_PROFILE(ColorGroup.Profile),
    CLONE_PROFILE(ColorGroup.Profile),
    STORE_PROFILE(ColorGroup.Profile),
    PROFILE_SWITCH(ColorGroup.Profile),
    PROFILE_SWITCH_CLONED(ColorGroup.Profile),
    CLOSED_LOOP_MODE(ColorGroup.Loop),
    LGS_LOOP_MODE(ColorGroup.Loop),
    OPEN_LOOP_MODE(ColorGroup.Loop),
    LOOP_DISABLED(ColorGroup.Loop),
    LOOP_ENABLED(ColorGroup.Loop),
    LOOP_CHANGE(ColorGroup.Loop),
    LOOP_REMOVED(ColorGroup.Loop),
    RECONNECT(ColorGroup.Pump),
    DISCONNECT(ColorGroup.Pump),
    RESUME(ColorGroup.Loop),
    SUSPEND(ColorGroup.Loop),
    HW_PUMP_ALLOWED(ColorGroup.Pump),
    CLEAR_PAIRING_KEYS(ColorGroup.Pump),
    ACCEPTS_TEMP_BASAL(ColorGroup.BasalTreatment),
    CANCEL_TEMP_BASAL(ColorGroup.BasalTreatment),
    CANCEL_BOLUS(ColorGroup.InsulinTreatment),
    CANCEL_EXTENDED_BOLUS(ColorGroup.InsulinTreatment),
    CANCEL_TT(ColorGroup.TT),
    CAREPORTAL(ColorGroup.Careportal),
    SITE_CHANGE(ColorGroup.Pump),
    RESERVOIR_CHANGE(ColorGroup.Pump),
    CALIBRATION(ColorGroup.Careportal),
    PRIME_BOLUS(ColorGroup.Pump),
    TREATMENT(ColorGroup.InsulinTreatment),
    CAREPORTAL_NS_REFRESH(ColorGroup.Careportal),
    PROFILE_SWITCH_NS_REFRESH(ColorGroup.Profile),
    TREATMENTS_NS_REFRESH(ColorGroup.InsulinTreatment),
    TT_NS_REFRESH(ColorGroup.TT),
    AUTOMATION_REMOVED(ColorGroup.Aaps),
    BG_REMOVED(ColorGroup.Aaps),
    CAREPORTAL_REMOVED(ColorGroup.Careportal),
    EXTENDED_BOLUS_REMOVED(ColorGroup.InsulinTreatment),
    FOOD_REMOVED(ColorGroup.CarbTreatment),
    PROFILE_REMOVED(ColorGroup.Profile),
    PROFILE_SWITCH_REMOVED(ColorGroup.Profile),
    RESTART_EVENTS_REMOVED(ColorGroup.Aaps),
    TREATMENT_REMOVED(ColorGroup.InsulinTreatment),
    BOLUS_REMOVED(ColorGroup.InsulinTreatment),
    CARBS_REMOVED(ColorGroup.CarbTreatment),
    TEMP_BASAL_REMOVED(ColorGroup.BasalTreatment),
    TT_REMOVED(ColorGroup.TT),
    NS_PAUSED(ColorGroup.Aaps),
    NS_RESUME(ColorGroup.Aaps),
    NS_QUEUE_CLEARED(ColorGroup.Aaps),
    NS_SETTINGS_COPIED(ColorGroup.Aaps),
    ERROR_DIALOG_OK(ColorGroup.Aaps),
    ERROR_DIALOG_MUTE(ColorGroup.Aaps),
    ERROR_DIALOG_MUTE_5MIN(ColorGroup.Aaps),
    OBJECTIVE_STARTED(ColorGroup.Aaps),
    OBJECTIVE_UNSTARTED(ColorGroup.Aaps),
    OBJECTIVES_SKIPPED(ColorGroup.Aaps),
    STAT_RESET(ColorGroup.Aaps),
    DELETE_LOGS(ColorGroup.Aaps),
    DELETE_FUTURE_TREATMENTS(ColorGroup.Aaps),
    EXPORT_SETTINGS(ColorGroup.Aaps),
    IMPORT_SETTINGS(ColorGroup.Aaps),
    SELECT_DIRECTORY(ColorGroup.Aaps),
    RESET_DATABASES(ColorGroup.Aaps),
    RESET_APS_RESULTS(ColorGroup.Aaps),
    CLEANUP_DATABASES(ColorGroup.Aaps),
    EXPORT_DATABASES(ColorGroup.Aaps),
    IMPORT_DATABASES(ColorGroup.Aaps),
    OTP_EXPORT(ColorGroup.Aaps),
    OTP_RESET(ColorGroup.Aaps),
    STOP_SMS(ColorGroup.Aaps),
    FOOD(ColorGroup.CarbTreatment),
    EXPORT_CSV(ColorGroup.Aaps),
    START_AAPS(ColorGroup.Aaps),
    EXIT_AAPS(ColorGroup.Aaps),
    PLUGIN_ENABLED(ColorGroup.Aaps),
    PLUGIN_DISABLED(ColorGroup.Aaps),
    UNKNOWN(ColorGroup.Aaps)
    ;

    companion object {

        fun fromString(source: String?) = entries.firstOrNull { it.name == source } ?: UNKNOWN
    }

    enum class ColorGroup {
        InsulinTreatment,
        BasalTreatment,
        CarbTreatment,
        TT,
        Profile,
        Loop,
        Careportal,
        Pump,
        Aaps
    }
}
